﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MethodWorx.CMS.Xml;

namespace MethodWorx.CMS.TemplateLanguage.Design
{
    public static class ControlInitializerHelper
    {
        public static string AddToTemplate(string content, IXmlElement input, string initializer)
        {
            switch (initializer.ToLower())
            {
                case "insert after":
                    return input.OuterXml + "\r\n" + content;
                    break;
                case "insert before":
                    return content + "\r\n" + input.OuterXml;
                    break;
                case "insert child":
                    input.Append("\r\n" + content);
                    return input.OuterXml;
                    break;
                default:
                    return content;
                    break;
            }
        }

        public static string[] GetInitializers()
        {
            return new string[] {"Replace Selection", "Wrap Selection", "Insert After", "Insert Before"};
        }
    }
}
